<template>
  <div id="app">
    <!-- 头部 -->
    <Topbar />
    <!-- 头部导航 -->
    <Header />
    <router-view />
    <!-- 底部 -->
    <Footer />
    <Login v-show="isShowLoginModal" />
    <!-- <button @click="fn">点击发送请求</button> -->
  </div>
</template>
<script>
import Topbar from "@/components/Topbar.vue";
import Header from "@/components/Header.vue";
import Footer from "@/components/Footer.vue";
import Login from "@/components/Login.vue";

import { JingPinAPI } from "@/requst/api.js";
import { mapState } from "vuex";
export default {
  components: {
    Topbar,
    Header,
    Footer,
    Login,
  },
  // created() {
  //   JingPinAPI().then((res) => {
  //     console.log("res:", res);
  //     console.log(res.data.data.data.records);
  //   });
  // },
  methods: {
    async fn() {
      // await 后面可以是一个promise对象
      // await 需要在async 修饰的函数内使用
      let res = await JingPinAPI();
      console.log("app-res1", res);
    },
  },
  computed: {
    ...mapState({
      isShowLoginModal: (state) => state.showModal.isShowLoginModal,
    }),
  },
};
</script>
<style lang="less">
</style>
